package com.zero.guava.samples.ComparisonChainDemo;

import com.google.common.collect.ComparisonChain;

public class Girl2 implements Comparable<Girl2>{


    private String name;//名称
    private double height;//身高
    private String face;//长相

    Girl2(String name, double height, String face) {
        this.name = name;
        this.height = height;
        this.face = face;
    }

    @Override
    public int compareTo(Girl2 girl) {
        return ComparisonChain.start()
                .compare(name, girl.name)
                .compare(height, girl.height)
                .compare(face, girl.face)
                .result();
    }
}
